import t2b
import unittest

class t2b_test(unittest. TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_convert(self):
        t_url = "http://twitter.com"
        n_url = "http://www.naver.com"
        rid = "test"
        uid = "nikelite"
        tid = "111"

        text = "@%s %s" % (rid, n_url) 
        r_html = "<a href='%s/%s'>%s</a>" % (t_url, rid, rid)
        l_html = "<a href='%s'>%s</a>" % (n_url, n_url)
        i_html = "<a href='%s/%s/status/%s'>#</a>" % \
                    (t_url, uid, tid) 
        text_html = "%s %s %s" % (r_html, l_html, i_html)
        test_html = t2b.make_html(uid, tid, text)
        self.assertEquals(test_html, text_html)

if __name__ == '__main__':
    unittest.main(argv=('','-v'))



